package ws.jdbc.concurrent.driver.sqlserver.cursor.shared;

import java.sql.Date;
import java.sql.SQLException;
import java.util.concurrent.locks.ReentrantLock;
import ws.jdbc.concurrent.driver.sqlserver.CResultSet;
import ws.jdbc.concurrent.driver.sqlserver.Messages;
import ws.jdbc.concurrent.driver.sqlserver.tds.TDSMessage;

/**
 * Scrollable and read-only result set cursor, with shared cache.
 * 
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public class CursorScrollableReadOnly extends CursorSharedCache {

  public CursorScrollableReadOnly(final TDSMessage message, final CResultSet crs, final ReentrantLock lock) throws SQLException {
    super(message, crs, lock);
  }

  // <editor-fold defaultstate="collapsed" desc="Operations not supported by read-only result set.">
  @Override
  public void cancelRowUpdates() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void moveToCurrentRow() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void moveToInsertRow() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void updateDate(int columnIndex, Date x) throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void updateDouble(int columnIndex, double x) throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void updateInt(int columnIndex, int x) throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void updateString(int columnIndex, String x) throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void insertRow() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void updateRow() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public void deleteRow() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }

  @Override
  public boolean rowDeleted() throws SQLException {
    throw new SQLException(Messages.msg_read_only);
  }
  // </editor-fold>
}
